package com.atguigu.guli.service.edu.mapper;

import com.atguigu.guli.service.base.dto.CourseDto;
import com.atguigu.guli.service.edu.entity.Course;
import com.atguigu.guli.service.edu.entity.vo.CourseDetailsVo;
import com.atguigu.guli.service.edu.entity.vo.CoursePublishVo;
import com.atguigu.guli.service.edu.entity.vo.CourseVO;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 * 课程 Mapper 接口
 * </p>
 *
 * @author atguigu
 * @since 2021-07-26
 */
public interface CourseMapper extends BaseMapper<Course> {

    //mp会自动组装分页参数，会自动组装queryWrapper
    //@Param(Constants.WRAPPER) 和 xml文件中的 ${ew.customSqlSegment}对应
    List<CourseVO> selectPageByCourseSearch(Page<CourseVO> page, @Param("ew")QueryWrapper<CourseVO> queryWrapper);

    CoursePublishVo getCoursePublishVoById(String id);

    CourseDetailsVo getCourseDetails(String id);

    CourseDto selectCourseDtoById(String courseId);
}
